package com.zhuss.intention.intention;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.intention.intention.DetailPersonalIntentionBo;
import com.zhuss.bean.bo.intention.intention.SearchPersonalIntentionBo;
import com.zhuss.common.ReadService;
import com.zhuss.exception.DzcxException;
import com.zhuss.intention.processor.PersonalIntentionRead;

/**
 * @description: 个人需求查询Service
 * @author: zhushanshuo
 * @create: Fri Dec 25 09:39:45 CST 2020
 **/
@Component("personalIntentionReadService")
public class PersonalIntentionReadService implements ReadService<Object, Object> {

	@Autowired
	@Qualifier("personalIntentionRead")
	private PersonalIntentionRead personalIntentionRead;

	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws DzcxException {
		DetailPersonalIntentionBo bo = (DetailPersonalIntentionBo) param;
		Long personalIntentionId = bo.getIntentionId();
		Object vo = personalIntentionRead.detail(personalIntentionId);

		return vo;
	}

	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) {
		SearchPersonalIntentionBo bo = (SearchPersonalIntentionBo) param;
		Object result = personalIntentionRead.list(bo);
		return result;
	}

}

